package cc.yugu.yhdw.common.domain.hdw;

import cc.yugu.yhdw.common.domain.StringIdEntity;
import cc.yugu.yhdw.common.entity.json.DateTimeSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 电动车
 */
public class Bicycle extends StringIdEntity {
    protected Integer customerId; //
    protected Date refreshTime; //
    protected Date createTime; //
    protected String batteryId; //
    protected Double lng; //
    protected Double lat; //
    protected String orderId; //
    int mileage;//
    long totalMileage;//总里程
    public enum Id {
        ONE("0", "00000000"),
        TOW("1", "00000001"),
        THREE("2", "00000002"),
        FOUR("3", "00000003"),
        FIVE("4", "00000004"),
        SIX("5", "00000005"),
        SEVEN("6", "00000006"),
        EIGHT("7", "00000007"),
        NINE("8", "00000008"),
        TEN("9", "00000009"),
        ELEVEN("A", "0000000A"),
        TWELVE("B", "0000000B"),
        THIRTEEN("C", "0000000C"),
        FOURTEEN("D", "0000000D"),
        FIFTEEN("E", "0000000E"),
        SIXTEEN("F", "0000000F");

        private final String value;
        private final String name;

        private Id(String value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<String, String> map = new HashMap<String, String>();

        static {
            for (Id e : Id.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    protected String customerName;
    String customerMobile;

    public Double getLng() {
        return lng;
    }

    public void setLng(Double lng) {
        this.lng = lng;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public String getCustomerMobile() {
        return customerMobile;
    }

    public void setCustomerMobile(String customerMobile) {
        this.customerMobile = customerMobile;
    }

    public int getMileage() {
        return mileage;
    }

    public void setMileage(int mileage) {
        this.mileage = mileage;
    }

    public long getTotalMileage() {
        return totalMileage;
    }

    public void setTotalMileage(long totalMileage) {
        this.totalMileage = totalMileage;
    }

    public String getBatteryId() {
        return batteryId;
    }

    public void setBatteryId(String batteryId) {
        this.batteryId = batteryId;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getRefreshTime() {
        return refreshTime;
    }

    public void setRefreshTime(Date refreshTime) {
        this.refreshTime = refreshTime;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }
}
